package com.cloudnews;

import java.io.Serializable;
import java.util.List;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.cloudnews.model.news.Stories;

@Named
@RequestScoped
public class StoryListHome implements Serializable {
	
	@PersistenceContext
	private EntityManager em;
	
	public List<Stories> listAll(){
		List<Stories> l = em.createQuery("SELECT a FROM Stories A").getResultList();
		return l;
	}
}
